Skip to content

Fix incorrect platform detection in setenvvar.bat on VS2022#8866

Open
tomneko wants to merge 1 commit intoFirebirdSQL:B3_0_Releasefrom
tomneko:fix-setenvvar-platform-detection
Open

Fix incorrect platform detection in setenvvar.bat on VS2022#8866
tomneko wants to merge 1 commit intoFirebirdSQL:B3_0_Releasefrom
tomneko:fix-setenvvar-platform-detection

Conversation

@tomneko
Copy link

@tomneko tomneko commented Jan 22, 2026

This pull request fixes incorrect platform detection in setenvvar.bat when
building Firebird on modern Visual Studio environments (VS2022 Build Tools).

The current script relies on PROCESSOR_ARCHITECTURE, which always reports
AMD64 even when using the x86 Native Tools Command Prompt. As a result,
FB_TARGET_PLATFORM is always set to x64, and Win32 builds do not behave
correctly.

This patch replaces the detection logic with the %Platform% variable, which
correctly reports x86 or x64 depending on the toolchain.

Fixes #8865

@dyemanov dyemanov requested a review from hvlad March 19, 2026 12:01

::set FB_PROCESSOR_ARCHITECTURE=AMD64
:: 1. Determine target platform
if "%Platform%"=="x86" set FB_TARGET_PLATFORM=Win32
Copy link
Member

@hvlad hvlad Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this variable is defined by VS 2017 and VS 2022 and not defined by VS 2013.
Official compiler for FB3 is VS 2010.
Afraid this patch can be applied to the FB4+ only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants